package com.example.test.filter;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TransactionFilter {
    TransactionFilter chain;
    public void doFilter(ServletRequest request, ServletResponse response){
        try {
            chain.doFilter(request,response);
        } catch (Exception e) {
            System.out.println("dilter捕获到异常了");
            try {
                HttpServletRequest req=(HttpServletRequest)request;
                HttpServletResponse resp=(HttpServletResponse)response;
                resp.sendRedirect(req.getContextPath()+"/page/cart/checkerror.html");
            }catch (Exception e1){

            }
        }
    }
}
